Swaps two elements of an array.
#include <Array.au3>
_ArraySwap ( $sVector1, $sVector2 )
Parameters
$sVector1 | First element in the array to be swapped. |
$sVector2 | Second element in the array to be swapped. |
Return Value
None.
Remarks
This function swaps the 2 elements in place (they're passed by reference) and so don't do any error checking or returning of values.
Related
_ArrayReverse
Example
#include <Array.au3>
Dim $asArray[2]
$asArray[0] = "World!"
$asArray[1] = "Hello"
_ArrayDisplay( $asArray, "_ArraySwap() - BEFORE" )
_ArraySwap( $asArray[0], $asArray[1] )
_ArrayDisplay( $asArray, "_ArraySwap() - AFTER" )
Exit